﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>

    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <script src="js/jquery-1.11.2.js"></script>
    <script src="js/m.js"></script>
    <script src="js/md5.min.js"></script>
</head>

<body>
    <div class="row">
        <a class="btn btndefault login">登陆</a>

        <a class="btn btndefault business">业务请求</a>
    </div>
    <script type="text/javascript">
        new Kmer({
            'AppRootPath': '',
            'CurrentUrl': ''
        });
        //new window.Admin({});
        /**
         * 设置Cookie
         */
        var KmerSetCookie = Y.SetCookie;
        /**
         * 取Cookie
         * @param name cookie名称
         * @return string
         */
        var KmerGetCookie = Y.GetCookie;

        $('.login').click(function (e) {

            Y.API2("Login", "Login", {
                "UserName": "caidongming",
                "PassWord": md5('123456')
            }, function (data) {
                if (data.Success == false) {
                    alert(data.Message);
                } else {
                    sessionStorage.setItem('login-info', JSON.stringify(data));
                }
            });
        });

        $(".business").click(function () {
            Y.API2("Login", "GetUserInfo", {UserID:2035}, function (data) {
                if (data.Success == false) {
                    alert("什么鬼");
                } else {
                    //console.log(list);
                    alert(data);
                }
            })
            return false;
        })
    </script>
</body>
</html>